package com.hdu.dwh.pojos;

import java.util.List;

import org.yaml.snakeyaml.scanner.Constant;

import com.hdu.dwh.dtos.cdc_dtos.FlinkJobDto;
import com.hdu.dwh.enums.ClaimMode;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

@Data
public class FlinkJobRequest<CdcTemplate> {
    @Schema(description = "是否允许非还原状态启动", defaultValue = "false", hidden = true)
    Boolean allowNonRestoredState = false;
    @Schema(description = "状态声明模式", defaultValue = "CLAIM", hidden = true)
    ClaimMode claimMode = ClaimMode.CLAIM;
    
    FlinkConfiguration flinkConfiguration;

    @Schema(description = "并行度", defaultValue = "1")
    Integer parallelism = 1;

    @Schema(hidden = true)
    List<String> programArgsList;

    @Schema(description = "恢复模式", defaultValue = "CLAIM", hidden = true)
    ClaimMode restorMode = ClaimMode.CLAIM;

    @Schema(description = "Flink作业的入口类", defaultValue = "org.apache.paimon.flink.action.FlinkActions", hidden = true)
    String entryClass;

    @Schema(description = "保存点路径", hidden = true)
    String savepointPath = null;

    private CdcTemplate request;
}

@Data
class FlinkConfiguration {
    @Schema(description = "Flink配置的其他属性，格式为key1=value1;key2=value2", example = "")
    String additionalProperties;
}